package leetcode.code079;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public abstract class Solution079 implements IDebug {

	public abstract boolean exist(char[][] board, String word);

	@Override
	public void debug1() {
		// 输入：board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]],
		// word = "ABCCED"
		// 输出：true
		String str1 = "[[\"A\",\"B\",\"C\",\"E\"],[\"S\",\"F\",\"C\",\"S\"],[\"A\",\"D\",\"E\",\"E\"]]";
		String word = "ABCCED";
		boolean expect = true;
		this.debug(str1, word, expect);
	}

	private void debug(String str1, String word, boolean expect) {
		char[][] board = HelpDebug.str2array5(str1);
		boolean result = this.exist(board, word);
		HelpDebug.compare(expect, result);
	}

	@Override
	public void debug2() {
		// 输入：board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word =
		// "SEE"
		// 输出：true
		String str1 = "[[\"A\",\"B\",\"C\",\"E\"],[\"S\",\"F\",\"C\",\"S\"],[\"A\",\"D\",\"E\",\"E\"]]";
		String word = "SEE";
		boolean expect = true;
		this.debug(str1, word, expect);
	}

	@Override
	public void debug3() {
		// 输入：board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word =
		// "ABCB"
		// 输出：false
		String str1 = "[[\"A\",\"B\",\"C\",\"E\"],[\"S\",\"F\",\"C\",\"S\"],[\"A\",\"D\",\"E\",\"E\"]]";
		String word = "ABCB";
		boolean expect = false;
		this.debug(str1, word, expect);
	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

}
